package com.hzhjhh.view.manageView.menus.storage.addGoods;

import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.view.manageView.menus.storage.AddGoodsDialog;
import com.hzhjhh.view.manageView.menus.storage.constant.ShowConstants;

/**
 * 菜单栏初始化-仓库-新增商品-重置按钮
 * 
 * @author 12083
 *
 */
public class ResetBt {

	/**
	 * 按钮
	 */
	public static JButton btInit(AddGoodsDialog addGoodsDialog) {
		JButton reset = new JButton();
		reset.setBounds(274, 418, 127, 27);
        reset.setText("重  置");
        reset.addActionListener(event -> {
        	Vector addAllData = addGoodsDialog.getAddAllData();
        	JTable jTable1 = addGoodsDialog.getJTable1();
        	JScrollPane jScrollPane1 = addGoodsDialog.getJScrollPane1();
        	
        	addAllData.removeAllElements();
    		jTable1 = Mytable.maketable(addAllData, ShowConstants.ADD_GOODS_HEAD_NAME); // 显示内容
    		jScrollPane1.getViewport().add(jTable1);
        });
		return reset;
	}
}
